<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="author" content="www.cnadlm.com" />
<link href="<?=domain?>static/style/union.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=domain?>static/script/core.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/script/home.js" charset="utf-8"></script>
<title><?=name?>-收款帐户</title>
<body>
<div class="nav">
	<div class="list">
		<ul>
		  <?php
		  foreach($menu as $key=>$value){
		  ?>
		  <li><a href="<?=($value['value'])?>"><?=$value['name']?></a></li>
		  <?php
		  }
		  ?>
		 </ul>
	</div>
</div>
<div class="main">
	<div class="logo"><a href="<?=domain?>"><img src="<?=domain?>static/image/Logo.png"></a></div>
	<div class="content">
		<div class="home_nav">
			<div class="l"></div>
			<div class="c">
		        <ul>
		          <?php
		          	$current=-1;
					foreach($HomeMenu as $key=>$value){
						if(stripos($_SERVER['SCRIPT_NAME'],substr($value['value'],0,strpos($value['value'],'/')))){
							$current=$key;
						}
				  ?>
		          <li<?=($current==$key?' class="sel"':'')?>><a href="<?=domain?>home/<?=$value['value']?>"><?=$value['name']?></a></li>
		          <?php
					}
		          ?>
		          <li><a href="<?=domain?>action/logout.php">安全退出</a></li>
		        </ul>
			</div>
			<div class="r"></div>
		</div>
		<div class="manage">
			<div class="left">
				<div class="module" style="height:510px;">
					<div class="bar"><div>支付结算&nbsp;>&nbsp;收款帐户</div></div>
					<div class="handle">
						<?php
							if(!empty($message)){
								foreach($message['msg'] as $key => $value){
						?>
						<div class="message <?=$message['result']?'success':'error';?>">
							<div class="msg"><?=$message['msg'][$key]?></div>
							<div class="close"></div>
						</div>
						<?php
							}}
						?>
						<form name="bank" method="post" action="<?=domain?>home/payment/bank.php">
						<div class="action">收款帐户</div>
						<div class="form">
							<div class="m">帐户类型：</div>
							<div class="s">
								<select size="1" name="type" style="width:249px;"<?=(isset($type)?' now="'.$type.'"':'')?>>
									<option value="0">个人账户</option>
									<option value="1">公司账户</option>
								</select>
							</div>
							<div class="e c"><font color="red">*</font>,请设置您的帐户类型.</div>
						</div>
						<div class="form">
							<div class="m">开户银行：</div>
							<div class="s">
								<select size="1" name="company" style="width:249px;"<?=(isset($company)?' now="'.$company.'"':'')?>>
									<option value="" selected >请选择开户银行...</option>
									<?php
									foreach($bank as $key=>$value){
										echo '<option value="'.$value['id'].'">'.$value['name'].'</option>';
									}
									?>
								</select>
							</div>
							<div class="e c"><font color="red">*</font>,请设置您的开户银行</div>
						</div>
						<div class="form">
							<div class="m">开户支行：</div>
							<div class="s"><input type="text" name="subbranch" value="<?=$subbranch?>" size="30" maxlength="32"/></div>
							<div class="e c"><font color="red">*</font>,如"中国工商银行浙江省分行平湖市支行人民分理处".</div>
						</div>
						<div class="form">
							<div class="m">开户所在省：</div>
							<div class="s">
							<select size="1" name="province" style="width:249px;"<?=(isset($province)?' now="'.$province.'"':'')?>>
								<option selected="selected" value="">请选择...</option>
							</select>
							</div>
							<div class="e c"><font color="red">*</font>,请设置您的开户所在省</div>
						</div>
						<div class="form">
							<div class="m">开户所在市：</div>
							<div class="s">
								<select size="1" name="city" style="width:249px;"<?=(isset($city)?' now="'.$city.'"':'')?>>
									<option value="">请选择...</option>
								</select>
							</div>
							<div class="e c"><font color="red">*</font>,请设置您的开户所在市</div>
						</div>
						<div class="form">
							<div class="m">银行帐号：</div>
							<div class="s"><input type="text" name="account" value="<?=$account?>" size="30" maxlength="32"/></div>
							<div class="e c"><font color="red">*</font>,如:6222020200088888888.</div>
						</div>
						<div class="form">
							<div class="m">开户姓名：</div>
							<div class="s"><input type="text" name="name" value="<?=$name?>" size="30" maxlength="32"/></div>
							<div class="e c"><font color="red">*</font>,请设置您的开户的真实姓名</div>
						</div>
						<div class="form">
							<div class="m">帐户状态：</div>
							<div class="e"><font color="red"><?=($locked==0?'可用':($locked==1?'审核中':($locked==2?'无效':'未填写')));?></font></div>
						</div>
						<div class="form">
							<div class="m">备注：</div>
							<div class="e"><font color="red"><?=$remark?></font></div>
						</div>
						<div class="form"><input type="submit" name="submit" value="保存" class="bg"/></div>
						<div class="form"></div>
						</form>
					</div>
				</div>
			</div>
<script language="JavaScript" type="text/javascript">
var china=<?=json_encode($china)?>,SelCom=$('select[name="company"]'),SelProv=$('select[name="province"]'),SelCity=$('select[name="city"]'),SelType=$('select[name="type"]');
SelCom.children('option[value="'+SelCom.attr('now')+'"]').attr('selected','selected');
SelType.children('option[value="'+SelType.attr('now')+'"]').attr('selected','selected');
for(key in china){
	if(SelProv.attr('now')==china[key]['id']){
		for(k in china[key]['child']){
			if(SelCity.attr('now')==china[key]['child'][k]['id']){
				SelCity.append('<option value="'+china[key]['child'][k]['id']+'" selected>'+china[key]['child'][k]['name']+'</option>');
			}
		}
		SelProv.append('<option value="'+china[key]['id']+'" selected>'+china[key]['name']+'</option>');
	}else{
		SelProv.append('<option value="'+china[key]['id']+'">'+china[key]['name']+'</option>');
	}
}
SelProv.change(function(){
	var Sel=SelProv.children('option:selected').attr('value');
	var list=null;
	for(key in china){
		if(Sel==china[key]['id']){
			SelCity.empty();
			for(k in china[key]['child']){
				SelCity.append('<option value="'+china[key]['child'][k]['id']+'">'+china[key]['child'][k]['name']+'</option>');
			}
			break;
		}
	}
});
</script>
			<div class="right">
				<div class="module">
					<div class="bar"><div>支付结算</div></div>
					<div class="handle">
						<?php
							foreach($HomeMenu[$current]['child'] as $key=>$value){
						?>
						<a href="<?=domain?>home/<?=$value['value']?>"><?=(stripos($_SERVER['SCRIPT_NAME'],strrchr($value['value'],'/'))!==false?'▬&nbsp;':'')?><?=$value['name']?></a>
						<?php
							}
						?>
					</div>
				</div>
			</div>
		</div>
		<div class="footer">
			<?=$foot?>
		</div>
	</div>
</div>
</body>
</html>